<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="viewport" content="target-densitydpi=640,width=1280,user-scalable=yes">
    <base href="<?php echo $system['siteRoot'];?>" />
    <title>个人资料</title>
    <?php import_tpl("fragment/icon.php"); ?>
    <link rel="stylesheet" href="plugin/reset.css"/>
    <link rel="stylesheet" href="plugin/awesome4/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="style/common.css"/>
    <link rel="stylesheet" href="style/personal-profile.css"/>
    <script src="plugin/jquery-1.11.2.min.js"></script>
    <script type="text/javascript">
    (function(){
        $(function(){
            console.log("bb");
            $('.slide .info').addClass('menu-normal').removeClass('menu-label');
            $("#selProvinces2").change(function(){
                var parent=$(this).val();
       $.ajax({
        url: '../my/ajaxurl/',
        type: 'POST',
        data:  {parent: parent ,type:2 },
        dataType: 'json',
        success:function(str){
          $("#selCities2").html(str);
        },
        error:function(){
            alert('获取用户信息失败，请尝试刷新');
        }
    }) 
    })
    
        $("#selCities2").change(function(){
                var parent=$(this).val();
       $.ajax({
        url: '../my/ajaxurl/',
        type: 'POST',
        data:  {parent: parent ,type:3 },
        dataType: 'json',
        success:function(str){
          $("#selDistricts2").html(str);
        },
        error:function(){
            alert('获取用户信息失败，请尝试刷新');
        }
    }) 
    })
    
    
        })
    })()
 
     console.log("ff");
    </script>
    <script type="text/javascript">_root='<?php echo $system['siteRoot'];?>'</script>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=HNtF8PpKdoLMQTDurEuZUVTE"></script>
    <style>
        #allmap{width:482px;height:230px;}
    </style>
    <script src="script/api.js"></script>
    <script src="script/img.js"></script>
    <script src="script/user-info.js?v=0.1"></script>
</head>
<body>
<div id="container" class="index">
    <?php import_part("custom.home","userBar"); ?>
    <?php import_part("custom.home","header"); ?>
    <?php import_tpl("fragment/nav.php"); ?>
    <div class="main-container">
        <div class="left">
            <?php import_tpl("fragment/mySlide.php"); ?>
            <div class="qr-code-box">
                <img src="images/weixin.png" alt="扫描二维码关注" title="关注我们的微信"/>
                <div>
                    <p class="weixin">扫描二维码</p>
                    <p class="concern">关注我们的微信</p>
                </div>
            </div>
        </div>
        <div class="right">
            <div class="personal-profile">
                <div class="profile-title">
                     <p>个人资料-基本信息</p>
                </div>
                <div class="profile-form">
                    <form id="user-info" action="<?php e_page('my','myModify') ?>" method="post">
                        <input type="hidden" name="idnum_pic" value="<?=$r['userInfo']['idnum_pic']?>">
                        <input type="hidden" name="id" value="<?=$r['userInfo']['id']?>">
                        <input type="hidden" name="user_id" value="<?=$r['user']['id']?>">
                        <label>
                            <span class="label-name">手机号码</span><span><?=$r['user']['username']?></span>
                        </label>
                        <label for="individual-name">
                            <span class="label-name">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名</span>
                            <input type="text" name="real_name" id="individual-name" value="<?=$r['userInfo']['real_name']?>">
                        </label>                        
                        <label for="mail-address">
                            <span class="label-name">邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;箱</span>
                            <input type="text" name="email" id="mail-address" value="<?=$r['user']['email']?>" placeholder="请输入您的邮箱">
                        </label>
                        <label for="birth-date">
                            <span class="label-name">出生日期</span>
                            <input type="date" name="birth" id="birth-date" value="<?=$r['userInfo']['birth']?>">
                        </label>
                        <label>
                            <span class="label-name">省市区</span>
                           <select name="province" id="selProvinces2">
                        <option value="0">请选择</option>
                        <?php  foreach($r['province_list'] as $k=>$region){?>
                        <option <?php if($r['user']['province_id'] == $region['region_id'] ) { echo 'selected="selected"' ;} ?> value="<?php echo $region['region_id']; ?>"><?php echo $region['region_name']; ?></option>
                        <?php } ?>
                      </select>
                            
                            <select name="city" id="selCities2">
                        <option value="0">请选择</option>
                        <?php foreach($r['placecity_list'] as $k=>$region){?>
                        <option <?php if($r['user']['city_id'] == $region['region_id'] ) { echo 'selected="selected"' ;} ?> value="<?php echo $region['region_id']; ?>"><?php echo $region['region_name']; ?></option>
                        <?php } ?>
                      </select>
                            
                            <select name="district" id="selDistricts2" >
                        <option value="0">请选择</option>
                        <?php foreach($r['placedistrice_list'] as $k=>$region){?>
                        <option <?php if($r['user']['district_id'] == $region['region_id'] ) { echo 'selected="selected"' ;} ?> value="<?php echo $region['region_id']; ?>"><?php echo $region['region_name']; ?></option>
                        <?php } ?>
                            </select>
                            
                        </label>
                        
                        <label>
                            <span class="label-name">详细地址</span>
                            <textarea name="detailaddress" style="width:205px;height:80px;padding-left: 6px;font-size: 13px;"><?php echo $r['user']['detailaddress']?></textarea>
                        </label>
                   
                        <label for="identity-card">
                            <span class="label-name">身份证号</span>
                            <input type="text" name="idnum" id="identity-card" value="<?=$r['userInfo']['idnum']?>">
                        </label>
                        <label class="id-photo-label">身份证照</label>

                        <div class="id-photo">
                            <img class="show-photo" src="<?php echo $r['userInfo']['idnum_url'];?>" alt="">
                            <span>（身份证照片必须清晰规范）</span>
                            <a href="javascript:" id="import-img-button"><i class="fa fa-plus-circle"></i>上传身份证照</a>
                            <input id="loader" name="photo" type="file" style="display:none;">
                        </div>
                        <label class="interests-label">兴趣爱好</label>
                        <div class="interests">
                            <label><input type="checkbox" name="love[]" value="农资" <?php if(in_array('农资',$r['hobbies'])) echo 'checked' ?>>农资</label>
                            <label><input type="checkbox" name="love[]" value="电影" <?php if(in_array('电影',$r['hobbies'])) echo 'checked' ?>>电影</label>
                            <label><input type="checkbox" name="love[]" value="酒店" <?php if(in_array('酒店',$r['hobbies'])) echo 'checked' ?>>酒店</label>
                            <label><input type="checkbox" name="love[]" value="休闲娱乐" <?php if(in_array('休闲娱乐',$r['hobbies'])) echo 'checked' ?>>休闲娱乐</label>
                            <label><input type="checkbox" name="love[]" value="美食" <?php if(in_array('美食',$r['hobbies'])) echo 'checked' ?>>美食</label>
                            <label><input type="checkbox" name="love[]" value="购物" <?php if(in_array('购物',$r['hobbies'])) echo 'checked' ?>>购物</label>
                        </div>
                        <label for="default-station-name" class="default-station-label">默认服务站</label>
                        <div class="default-station">
                            <select name="service_id" id="default-station-name">
                                <option value="0"></option>
                            </select>
                            <div id="allmap"></div>
                        </div>
                        <div class="modify-button">
                        </div>
                    </form>
                    <div class="modify-button" id="modify-info-button">
                        <a href="javascript:" >确认修改</a>
                    </div>
                </div>
                <div class="profile-title">
                    <p>修改密码</p>
                </div>
                <div class="modify-password">
                    <form id="pass" action="<?php e_page('my','passModify') ?>" method="post">
                        <input type="hidden" name="username" value="<?=$r['user']['username']?>">
                        <label><span class="label-name">当前密码</span><input type="password" name="pass" placeholder="请输入当前密码"></label>
                        <label><span class="label-name">新&nbsp;密&nbsp;码</span><input type="password" name="newPass" class="input-pass" placeholder="请设置新密码"></label>
                        <label><span class="label-name">确认新密码</span><input type="password" class="input-repass" placeholder="再次输入您的新密码"></label>
                        <label class="mistake-hint">！信息有错误，请核对您的当前密码以及新密码的两次输入是否正确。</label>
                    </form>
                    <div class="modify-button"  id="modify-pass-button">
                        <a href="javascript:">确认修改</a>
                    </div>
                </div>
            </div>
        </div> 
    </div>
    <?php import_tpl("fragment/footer.php"); ?>
</div>
</body>
</html>